Learn R Programming

HiddenMarkov (version 1.8-13)

Change Log: Changes Made to Package HiddenMarkov

Description

This page contains a listing of recent changes made to the package.

Arguments

Future Development

  1. The functions Viterbi and residuals need methods for objects of class mmpp.

  2. A number of the original functions have names that are too general. For example forwardback calculates the forward-backward probabilities, but only for the model dthmm. The corresponding function for the mmpp model is forwardback.mmpp. It would be more consistent to attach to these original functions a dthmm suffix.

  3. The demonstration examples are all for dthmm. Also need some for mmglm1, mmglmlong1 and mmpp.

Details

  1. Since we have included different classes of HMMs (see dthmm, mmglm0 and mmpp), it is much tidier to use an object orientated approach. This ensures that the functions across all models follow a more consistent naming convention, and also the argument list for the different model functions are more simple and consistent (see HiddenMarkov). (14 Sep 2007)

  2. The main tasks (model fitting, residuals, simulation, Viterbi, etc) can now be called by generic functions (see topic HiddenMarkov). The package documentation has been rearranged so that these generic functions contain the documentation for all model types (e.g. see BaumWelch). (14 Sep 2007)

  3. There are a number of functions, still contained in the package, that are obsolete. This is either because they do not easily fit into the current naming convention used to implement the more object orientated approach, or their argument list is slightly complicated. These functions have been grouped in the topics dthmm.obsolete and mmpp.obsolete. (14 Sep 2007)

  4. There are various second level functions. For example, the model fitting is achieved by the generic BaumWelch function. However, this will call functions to do the E-step, M-step, forward and backward probabilities, and so on. At the moment, these second level functions have not been modified into an object orientated approach. It is not clear at this point whether this would be advantageous. If one went down this route, then one would probably group all of the E-step functions (for all models) under the same topic. If not, then it may be best to group all second level functions for each model under the same topic (e.g. forwardback, probhmm and Estep would be grouped together, being the second level functions for the dthmm model). (14 Sep 2007)

  5. The original function called Viterbi has been renamed to Viterbihmm, and Viterbi is now a generic function. (14 Sep 2007)

  6. Programming code that uses old versions of the functions should still work with this revised version of the package. However, you will get warning messages stating that certain functions are deprecated, and suggesting a possible alternative. To get a quick overview of the programming style, have a look at the examples in topic dthmm. (09 Nov 2007)

  7. forwardback: for loops replaced by Fortran code; much faster. The corresponding R code is still contained within the function in case the Fortran has incompatibility issues. (23 Nov 2007)

  8. forwardback.mmpp: for loops replaced by Fortran code. The corresponding R code is still contained within the function in case the Fortran has incompatibility issues. (24 Nov 2007)

  9. Estep.mmpp: for loops replaced by Fortran code. Cuts time considerably. These loops in R used far more time than the forward and backward equations. The corresponding R code is still contained within the function in case the Fortran has incompatibility issues. (27 Nov 2007)

  10. forwardback.mmpp, forwardback and Estep.mmpp: argument fortran added. (3 Dec 2007)

  11. forwardback, forwardback.mmpp and Estep.mmpp: inclusion of all variable sized arrays in the Fortran subroutine call to be compatible with non gfortran compilers (3 Dec 2007); more added for calls to Fortran subroutines multi1 and multi2. (6 Dec 2007)

  12. Estep.mmpp: error in Fortran code of loop 6; j1=0 to j1=1. (5 Dec 2007)

  13. BaumWelch.mmpp: if (diff < 0) stop ... to if (diff < 0 & control$posdiff) stop ..., consistent with BaumWelch.dthmm. (11 Dec 2007)

  14. logLik.dthmm, logLik.mmglm0, logLik.mmpp: for loop replaced by Fortran code. (15 Feb 2008)

  15. dthmm: argument discrete set automatically for known distributions, stops if not set for unknown distributions. (15 Feb 2008)

  16. neglogLik, Pi2vector, vector2Pi, Q2vector, vector2Q: new functions providing an alternative means of calculating maximum likelihood parameter estimates. (18 Feb 2008)

  17. dthmm: argument nonstat was not set correctly. (21 Jun 2008)

  18. Hyperlinks on package vignettes page. (22 Jun 2008)

  19. mmpp: argument nonstat was not set correctly. (23 Jun 2008)

  20. The manual pages HiddenMarkov-dthmm-deprecated and HiddenMarkov-mmpp-deprecated have been given a keyword of “internal”. This hides them from the listing of package functions. (3 Jul 2008)

  21. All cited references are now only listed in the topic HiddenMarkov. (3 Jul 2008)

  22. neglogLik: argument updatep has been renamed to pmap. (9 Jul 2008)

  23. neglogLik: format of this function changed to be consistent with that in package PtProcess. Argument p renamed as params. (07 Aug 2008)

  24. mmglm0: remove some LaTeX specific formatting to be compatible with R 2.9.0. (26 Jan 2009)

  25. Viterbi: Correct hyperlink to base function which.max. (10 Oct 2009)

  26. Tidied HTML representation of equations in manual pages. (15 Dec 2009)

  27. mmglm: Renamed to mmglm0, new version mmglm1. See manual page for more details. (5 Jan 2010)

  28. mmglmlong1: new function for longitudinal data. (18 Jan 2010)

  29. dthmm: clarify argument distn on manual page, and nature of parameter estimates when the Markov chain is stationary. (04 Feb 2010)

  30. BaumWelch.mmglmlong1: new argument tmpfile added. (13 Feb 2010)

  31. Viterbi: Methods added for objects of class "mmglm1" and "mmglmlong1". (29 Jul 2010)

  32. logLik: Method added for object of class "mmglmlong1". (30 Jul 2010)

  33. forwardback.dthmm, forwardback.mmpp: New argument "fwd.only". (30 Jul 2010)

  34. logLik.dthmm: Calls forwardback.dthmm to perform calculations. (30 Jul 2010)

  35. logLik.mmpp: Calls forwardback.mmpp to perform calculations. (30 Jul 2010)

  36. Viterbi: Now generates an error message when applied to objects of class "mmpp". Method not currently available. (03 Aug 2010)

  37. "Viterbi.mmglm1": Fixed bug with number of Bernoulli trials specification when using a binomial family. (05 Aug 2010)

  38. residuals.dthmm, probhmm: Modify for greater efficiency and generality to accommodate more general models. Arguments of probhmm have also been changed. (05 Aug 2010)

  39. residualshmm: Made defunct, incompatible with revised probhmm. (05 Aug 2010)

  40. residuals: Methods added for objects of class "mmglm1" and "mmglmlong1". Generates an error message when applied to objects of class "mmpp", currently no method available. (05 Aug 2010)

  41. Add CITATION file. (24 Sep 2010)

  42. makedistn: Change eval(parse(text=paste(x, " list(log=log)))", sep=""))) to eval(parse(text=paste(x, " list(log.p=log)))", sep=""))). (19 Dec 2010)

  43. pglm, pmmglm: Change all log arguments to log.p. (19 Dec 2010)

  44. Revise examples in /tests directory. (02 May 2011)

  45. Implement very basic NAMESPACE and remove file /R/zzz.R. (5 Nov 2011)

  46. List functions explicitly in NAMESPACE. (19 Dec 2011)

  47. mmglm and neglogLik: Restrict the number of iterations in examples on manual pages to minimise time during package checks. (19 Dec 2011)

  48. modify.func: New function to allow the user to modify package functions in the NAMESPACE set-up. This function violates the CRAN policy as users are not supposed to change the NAMESPACE on such packages. Some examples where it is required to modify package functions will not work, for example, the second example in Mstep. (7 Mar 2012)

  49. modify.func: Function removed. See the second example in Mstep for a work-around when package functions need to be modified. (14 Apr 2012)

  50. Mstep: Revised documentation about distribution requirements and ways to include other distributions into the software framework. (14 Apr 2012)

  51. The package snow has been superseded by parallel, changed where needed. In BaumWelch.mmglmlong1 arguments makeSOCKcluster and SNOWcluster renamed to makePSOCKcluster and PSOCKcluster, respectively. Functions dmmglm and pmmglm added to exported namespace (required for parallel processing). (13 Aug 2014)

  52. BaumWelch.mmglmlong1: Call to clusterApply and clusterExport changed to parallel::clusterApply and parallel::clusterExport, respectively. (25 Sep 2014)

  53. Fix error in inst/CITATION file. (21 Jan 2015)

  54. Added to NAMESPACE: functions imported from stats. (06 Jul 2015)

  55. HiddenMarkov: Add DOI to some references, rename topic to appear first in table of contents. (16 Oct 2015)

  56. Fortran warning: in file src/extract.f, integer definitions should precede double precision definitions. (29 Aug 2016)

  57. Fix NOTES in R CMD check --as-cran: Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols' (17 Jun 2017)

  58. simulate.mchain: Change if (sum(object$delta)!=1) to if (!isTRUE(all.equal(sum(object$delta), 1))). (21 Oct 2017)

  59. simulate.mmpp: Change if (sum(object$delta)!=1) to if (!isTRUE(all.equal(sum(object$delta), 1))). (27 Oct 2017)

  60. Clarify various points in documentation. (27 Oct 2017)

  61. HiddenMarkov: Hyperlink update to Harte (2019); others updated to https where possible. (27 Apr 2021)